package com.dhcc.demo.api.controller;

import com.dhcc.core.api.annotion.ApiPermission;
import com.dhcc.core.api.controller.BaseApiController;
import com.dhcc.core.framework.result.R;
import com.dhcc.core.modules.system.entity.User;
import com.dhcc.sds.busi.service.ISdsQcincaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * API开放接口
 * 
 * @ClassName: ApiTestController
 * @Description: TODO
 * @author: zx
 * @date: 2022年11月15日 上午10:04:55
 */
@RestController
@RequestMapping("${sys.apiPath}")
@Api("开放接口")
public class ApiOpenController extends BaseApiController {
    @Autowired
    private ISdsQcincaseService sdsQcincaseService;
    /**
     * 获取用户信息
     */
    @GetMapping("getSDSUploadInfo")
    @ApiOperation(value = "获取单病种上报信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "episodeId", value = "就诊号", required = true) })
    @ResponseBody
    public R getSDSUploadInfo(@RequestParam String episodeId) {
        Map map = new HashMap();
        map.put("episodeId",episodeId);
        String res = sdsQcincaseService.selectUploadStateByEpisodeId(map);
        if("未入组".equals(res)||"已上报".equals(res)){
            return R.ok().put("result",res );
        }else{
            return R.error(res );
        }
    }

    
}
